package com.interview;

/**
 * ThreadDemo..
 *
 * @author Lizhong
 * @date 2019/9/5
 */
public class ThreadDemo  extends Thread {
    int a = 0;

    public void run() {
        if (a <= 0) {
            a++;
        } else {
            a--;
        }
        System.out.println(Thread.currentThread()+","+a);
    }

    public static void main(String[] args) {
        new ThreadDemo().start();
        new ThreadDemo().start();
    }
}
